import request from "@/utils/request";
// 下单管理列表
export function getOrderList(query) {
  return request({
    url: "/order/orderPre/list",
    method: "get",
    params: query,
  });
}
// 下单管理列表
export function getOrderListManage(query) {
  return request({
    url: "/order/order/list",
    method: "get",
    params: query,
  });
}
// 出租方
export function getCorrelationCompany(query) {
  return request({
    url: "/system/dept/getSubordinate",
    method: "get",
    params: query,
  });
}
// 出租方列表
export function getListNoPermission(query) {
  return request({
    url: "/system/dept/listNoPermission",
    method: "get",
    params: query,
  });
}

// 子订单列表
export function getOrderCar(query) {
  return request({
    url: "/order/orderCar/list",
    method: "get",
    params: query,
  });
}

// 子订单详情
export function getOrderCarDetail(orderCarId) {
  return request({
    url: `/order/orderCar/info/${orderCarId}`,
    method: "get",
  });
}


// 客户紧急联系人姓名
export function customerList(query) {
  return request({
    url: `/customer/customer/getAll`,
    method: "get",
    params: query
  });
}

// 获取用户列表 无分页
export function userList(query) {
  return request({
    url: `/system/user/list`,
    method: "get",
    params: query
  });
}

// 下单管理车型车辆明细列表
export function orderPrePlanDetail(query) {
  return request({
    url: `/order/orderPrePlan/list`,
    method: "get",
    params: query
  });
}

// 下单暂存
export function orderDraftSave(data) {
  return request({
    url: `/order/order/orderDraftSave`,
    method: "post",
    data: data
  });
}

// 下单提交
export function orderSubmit(data) {
  return request({
    url: `/order/order/orderSubmit`,
    method: "post",
    data: data
  });
}


// 买受人列表
export function customerCorrelationVendee(data) {
  return request({
    url: `/customerCorrelationVendee/getVendeeAll`,
    method: "post",
    data: data
  });
}

// 订单管理详情
export function getOrderDetail(orderId) {
  return request({
    url: `/order/order/info/${orderId}`,
    method: "get",
  });
}
// 司机选择下拉框
export function getDriverList(query) {
  return request({
    url: `/driver/driver/allList`,
    method: "get",
    params: query
  });
}
// 主订单下司机列表
export function getDriverListName(query) {
  return request({
    url: `/order/orderSupplementDriver/list`,
    method: "get",
    params: query
  });
}

// 分配司机
export function assignDriver(data) {
  return request({
    url: `/order/orderCar/assignDriver`,
    method: "post",
    data: data
  });
}

// 分配司机
export function getGenerateContract(orderId) {
  return request({
    url: `/order/order/generateContract/${orderId}`,
    method: "get",
  });
}




// 获取合同模板-合同约定
export function getRule(id) {
  return request({
    url: `/contractTemplate/contractTemplate/getRule/${id}`,
    method: "get",
  });
}

export function List(params) {
  return request({
    url: "/finance/financeProceeds/rentalPreviewList",
    method: "get",
    params,
  })
}


// 下单管理下单数据获取
export function orderPre(preOrderId) {
  return request({
    url: `/order/orderPre/info/${preOrderId}`,
    method: "get",
  })
}

// 查询首期租金
export function getFirstRent(orderCarId) {
  return request({
    url: `/order/orderCar/firstRent/${orderCarId}`,
    method: "get",
  })
}


// 订单修改
export function getCustomerContacts(customerId) {
  return request({
    url: `/customer/customer/getCustomerContacts/${customerId}`,
    method: "get",
  })
}


// 下单页面获取信审数据
export function getCreditReviewData(applicationNo) {
  return request({
    url: `/creditReview/creditReview/getInfo/${applicationNo}`,
    method: "get",
  })
}
// 查询当前子订单是否正在审批的替车流程
export function isApprovalProcess(params) {
  return request({
    url: `/replacementCar/isApprovalProcess`,
    method: "get",
    params,
  })
}

// 判断暂存
export function judgmentStaging(params) {
  return request({
    url: `/replacementCar/judgmentStaging`,
    method: "get",
    params,
  })
}

// 发起替车工单
export function startReplacementATicket(params) {
  return request({
    url: `/replacementCar/startReplacementATicket`,
    method: "get",
    params,
  })
}

// 新增替车
export function replacementCar(data) {
  return request({
    url: `/replacementCar`,
    method: "post",
    data,
  })
}
// 替车记录
export function replacementCarRecording(params) {
  return request({
    url: `/replacementCar/replacementCarRecording`,
    method: "get",
    params,
  })
}

